﻿@model IEnumerable<CatHouse.Models.UserModel>

@{
    ViewBag.CurrentPage = "contentpage";
    ViewBag.Title = "Danh sách tài khoản";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="container">
    <div class="row">
        <h4>Danh sách tài khoản</h4>
        <p>@Html.ActionLink("Thêm mới", "AddUser", new { @class = "btn-default" })</p>
    </div>
    <div class="row">
        @if (Model != null && Model.Any())
        {
            <table class="table tablesaw-stack table-saw" data-tablesaw-mode="stack" data-tablesaw-sortable data-tablesaw-sortable-switch>
                <thead>
                    <tr>
                        <th data-tablesaw-sortable-col data-tablesaw-sortable-default-col>
                            @Html.DisplayNameFor(model => model.ID)
                        </th>
                        <th data-tablesaw-sortable-col>
                            @Html.DisplayNameFor(model => model.Name)
                        </th>
                        <th data-tablesaw-sortable-col>
                            @Html.DisplayNameFor(model => model.Infomation)
                        </th>
                        <th data-tablesaw-sortable-col>
                            @Html.DisplayNameFor(model => model.UserEmail)
                        </th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @item.ID
                            </td>
                            <td>
                                @item.Name
                            </td>
                            <td>
                                @item.Infomation
                            </td>
                            <td>
                                @item.UserEmail
                            </td>
                            <td>
                                @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                                @Html.ActionLink("Details", "Details", new { id = item.ID }) |
                                @Html.ActionLink("Delete", "Delete", new { id = item.ID })
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        }

        else
        {
            <p>
                Chưa có tài khoản nào được tạo.
            </p>

        }
    </div>
</div>